<script setup lang="ts">
const emit = defineEmits(['close', 'confirm'])

defineProps({
  loading: {
    type: Boolean,
    default: false
  }
})
</script>

<template>
  <el-dialog
    width="600px"
    top="10vh"
    draggable
    append-to-body
    :close-on-click-modal="false"
    v-bind="$attrs"
    @close="emit('close')"
  >
    <slot></slot>
    <template #footer>
      <span class="dialog-footer">
        <el-button
          :disabled="loading"
          @click="emit('close')"
        >
          取消
        </el-button>
        <el-button
          type="primary"
          :disabled="loading"
          @click="emit('confirm')"
        >
          确定
        </el-button>
      </span>
    </template>
  </el-dialog>
</template>

<style scoped lang="less">

</style>
